﻿using GPS.COMMON;
using GPS.Controllers.GPS_NghiepVu;
using GPS.DataAccessLayer;
using GPS.ENTITYS;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;


namespace GPS.GPS_DAL
{
    public class GPS_CapPhepDAO
    {
        public List<CrudModelDCPDVGTVT> GPS_CAPPHEP_DTLX(string pDVGTVT_MA)
        {

            var _pKH_LH_DVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            var ds = OracleHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_CAPPHEP_DTLX"
                                                                , _pKH_LH_DVGTVT_MA
                                                                , _pRET
                                                                );
            var datas = GPS_Library.MapDataTableToList<CrudModelDCPDVGTVT>(ds.Tables[0]);
            return datas;

        }

        public CrudModelDCPGV GPS_CAPPHEP_CNGVDLX(string pDVGTVT_MA, string pGV_MA)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pGV_MA = new OracleParameter("pGV_MA", OracleDbType.Varchar2, (pGV_MA == null ? DBNull.Value : (object)pGV_MA), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            var datas = _db.DbContext.Database.SqlQuery<CrudModelDCPGV>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_CNGVDLX(:pDVGTVT_MA,:pGV_MA,:pRET); end;"
                                                                                                                            , _pDVGTVT_MA
                                                                                                                            , _pGV_MA
                                                                                                                            , _pRET).FirstOrDefault();
            
            return datas;
        }

        public CrudModelDCPGV GPS_GETEDIT_DCPGV(string pDVGTVT_MA, string pGV_MA)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pGV_MA = new OracleParameter("pGV_MA", OracleDbType.Varchar2, (pGV_MA == null ? DBNull.Value : (object)pGV_MA), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            var datas = _db.DbContext.Database.SqlQuery<CrudModelDCPGV>("BEGIN GPS_CAPPHEP.GPS_GETEDIT_DCPGV(:pDVGTVT_MA,:pGV_MA,:pRET); end;"
                                                                                                                            , _pDVGTVT_MA
                                                                                                                            , _pGV_MA
                                                                                                                            , _pRET).FirstOrDefault();

            return datas;
        }

        public List<CrudModelDCPGV> GPS_CAPPHEP_DCPGV(string pDCP_GV_DVGTVT_MA, string pDCP_GV_MA, string pDCP_GV_HODEM,string pDCP_GV_TEN,string pDCP_GV_HANGDT_MA,string pDCP_GV_SOCMT)
        {

            var _pDCP_GV_DVGTVT_MA = new OracleParameter("pDCP_GV_DVGTVT_MA", OracleDbType.Varchar2, (pDCP_GV_DVGTVT_MA == null ? DBNull.Value : (object)pDCP_GV_DVGTVT_MA), ParameterDirection.Input);
            var _pDCP_GV_MA = new OracleParameter("pDCP_GV_MA", OracleDbType.Varchar2, (pDCP_GV_MA == null ? DBNull.Value : (object)pDCP_GV_MA), ParameterDirection.Input);
            var _pDCP_GV_HODEM = new OracleParameter("pDCP_GV_HODEM", OracleDbType.Varchar2, (pDCP_GV_HODEM == null ? DBNull.Value : (object)pDCP_GV_HODEM), ParameterDirection.Input);
            var _pDCP_GV_TEN = new OracleParameter("pDCP_GV_TEN", OracleDbType.Varchar2, (pDCP_GV_TEN == null ? DBNull.Value : (object)pDCP_GV_TEN), ParameterDirection.Input);
            var _pDCP_GV_HANGDT_MA = new OracleParameter("pDCP_GV_HANGDT_MA", OracleDbType.Varchar2, (pDCP_GV_HANGDT_MA == null ? DBNull.Value : (object)pDCP_GV_HANGDT_MA), ParameterDirection.Input);
            var _pDCP_GV_SOCMT = new OracleParameter("pDCP_GV_SOCMT", OracleDbType.Varchar2, (pDCP_GV_SOCMT == null ? DBNull.Value : (object)pDCP_GV_SOCMT), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            var ds = OracleHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_CAPPHEP_DCPGV"
                                                                , _pDCP_GV_DVGTVT_MA
                                                                , _pDCP_GV_MA
                                                                , _pDCP_GV_HODEM
                                                                , _pDCP_GV_TEN
                                                                , _pDCP_GV_HANGDT_MA
                                                                , _pDCP_GV_SOCMT
                                                                , _pRET
                                                                );
            var datas = GPS_Library.MapDataTableToList<CrudModelDCPGV>(ds.Tables[0]);
            return datas;
        }


        public List<CrudModelDCPDVGTVT> GPS_CAPPHEP_GETLIST_DCPGTVT(string pDVGTVT_MA, string pDVGTVT_LOAI, string pDVGTVT_ACTIVE)
        {


            var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pDVGTVT_LOAI = new OracleParameter("pDVGTVT_LOAI", OracleDbType.Varchar2, (pDVGTVT_LOAI == null ? DBNull.Value : (object)pDVGTVT_LOAI), ParameterDirection.Input);
            var _pDVGTVT_ACTIVE = new OracleParameter("pDVGTVT_ACTIVE", OracleDbType.Varchar2, (pDVGTVT_ACTIVE == null ? DBNull.Value : (object)pDVGTVT_ACTIVE), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            var ds = OracleHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_CAPPHEP_GETLIST_DCPGTVT"
                                                                , _pDVGTVT_MA
                                                                , _pDVGTVT_LOAI
                                                                , _pDVGTVT_ACTIVE
                                                                , _pRET
                                                                );
            var datas = GPS_Library.MapDataTableToList<CrudModelDCPDVGTVT>(ds.Tables[0]);
            return datas;
        }


        public List<CrudModel_DLSPT> GPS_CAPPHEP_GETLIST_DLSPT(decimal? pID_PT, string pPT_BIENSO, string pPT_SODK, string pDVGTVT_MA, string pPT_ACTIVE)
        {

            try
            {
                var _pID_PT = new OracleParameter("pID_PT", OracleDbType.Decimal, (pID_PT == null ? DBNull.Value : (object)pID_PT), ParameterDirection.Input);
                var _pPT_BIENSO = new OracleParameter("pPT_BIENSO", OracleDbType.Varchar2, (pPT_BIENSO == null ? DBNull.Value : (object)pPT_BIENSO), ParameterDirection.Input);
                var _pPT_SODK = new OracleParameter("pPT_SODK", OracleDbType.Varchar2, (pPT_SODK == null ? DBNull.Value : (object)pPT_SODK), ParameterDirection.Input);
                var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
                var _pPT_ACTIVE = new OracleParameter("pPT_ACTIVE", OracleDbType.Varchar2, (pPT_ACTIVE == null ? DBNull.Value : (object)pPT_ACTIVE), ParameterDirection.Input);
                var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);

                string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
                var ds = OracleHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure
                                                                    , "GPS_CAPPHEP.GPS_CAPPHEP_GETLIST_DLSPT"
                                                                    , _pID_PT
                                                                    , _pPT_BIENSO
                                                                    , _pPT_SODK
                                                                    , _pDVGTVT_MA
                                                                    , _pPT_ACTIVE
                                                                    , _pRET
                                                                    );

                var datas = GPS_Library.MapDataTableToList<CrudModel_DLSPT>(ds.Tables[0]);
                return datas;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            
        }


        public CrudModel_DLSPT GPS_CAPPHEP_GETITEM_DLSPT(decimal? pID_PT, string pPT_BIENSO, string pPT_SODK, string pDVGTVT_MA, string pPT_ACTIVE)
        {

            
                DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
                var _pID_PT = new OracleParameter("pID_PT", OracleDbType.Decimal, (pID_PT == null ? DBNull.Value : (object)pID_PT), ParameterDirection.Input);
                var _pPT_BIENSO = new OracleParameter("pPT_BIENSO", OracleDbType.Varchar2, (pPT_BIENSO == null ? DBNull.Value : (object)pPT_BIENSO), ParameterDirection.Input);
                var _pPT_SODK = new OracleParameter("pPT_SODK", OracleDbType.Varchar2, (pPT_SODK == null ? DBNull.Value : (object)pPT_SODK), ParameterDirection.Input);
                var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
                var _pPT_ACTIVE = new OracleParameter("pPT_ACTIVE", OracleDbType.Varchar2, (pPT_ACTIVE == null ? DBNull.Value : (object)pPT_ACTIVE), ParameterDirection.Input);
                var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
                var datas = _db.DbContext.Database.SqlQuery<CrudModel_DLSPT>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_GETLIST_DLSPT(:pID_PT,:pPT_BIENSO, :pPT_SODK,:pDVGTVT_MA, :pPT_ACTIVE,:pRET); end;"
                                                                                                                            , _pID_PT
                                                                                                                            , _pPT_BIENSO
                                                                                                                            , _pPT_SODK
                                                                                                                            , _pDVGTVT_MA
                                                                                                                            , _pPT_ACTIVE
                                                                                                                            , _pRET
                                                                                                                            ).FirstOrDefault();
                return datas;
           

        }

        public CrudModelDCPDVGTVT GPS_CAPPHEP_GETITEM_DCPGTVT(string pDVGTVT_MA, string pDVGTVT_LOAI, string pDVGTVT_ACTIVE)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pDVGTVT_LOAI = new OracleParameter("pDVGTVT_LOAI", OracleDbType.Varchar2, (pDVGTVT_LOAI == null ? DBNull.Value : (object)pDVGTVT_LOAI), ParameterDirection.Input);
            var _pDVGTVT_ACTIVE = new OracleParameter("pDVGTVT_ACTIVE", OracleDbType.Varchar2, (pDVGTVT_ACTIVE == null ? DBNull.Value : (object)pDVGTVT_ACTIVE), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            var datas = _db.DbContext.Database.SqlQuery<CrudModelDCPDVGTVT>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_GETLIST_DCPGTVT(:pDVGTVT_MA,:pDVGTVT_LOAI, :pDVGTVT_ACTIVE,:pRET); end;"
                                                                                                                            , _pDVGTVT_MA
                                                                                                                            , _pDVGTVT_LOAI
                                                                                                                            , _pDVGTVT_ACTIVE
                                                                                                                            , _pRET).FirstOrDefault();

            return datas;
        }

        public CrudModelDCPDVGTVT GPS_CAPPHEP_GETEDIT_DCPGTVT(string pDVGTVT_MA, string pDVGTVT_LOAI, string pDVGTVT_ACTIVE)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pDVGTVT_MA = new OracleParameter("pDVGTVT_MA", OracleDbType.Varchar2, (pDVGTVT_MA == null ? DBNull.Value : (object)pDVGTVT_MA), ParameterDirection.Input);
            var _pDVGTVT_LOAI = new OracleParameter("pDVGTVT_LOAI", OracleDbType.Varchar2, (pDVGTVT_LOAI == null ? DBNull.Value : (object)pDVGTVT_LOAI), ParameterDirection.Input);
            var _pDVGTVT_ACTIVE = new OracleParameter("pDVGTVT_ACTIVE", OracleDbType.Varchar2, (pDVGTVT_ACTIVE == null ? DBNull.Value : (object)pDVGTVT_ACTIVE), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            var datas = _db.DbContext.Database.SqlQuery<CrudModelDCPDVGTVT>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_GETEDIT_DCPGTVT(:pDVGTVT_MA,:pDVGTVT_LOAI, :pDVGTVT_ACTIVE,:pRET); end;"
                                                                                                                            , _pDVGTVT_MA
                                                                                                                            , _pDVGTVT_LOAI
                                                                                                                            , _pDVGTVT_ACTIVE
                                                                                                                            , _pRET).FirstOrDefault();

            return datas;
        }


        public CrudModel_DLSPT GPS_CAPPHEP_DLSPT_CHECKEXITS(string pLSPT_DVGTVT_MA_CU, string pLSPT_DVGTVT_MA_MOI, string pLSPT_BIENSO)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pLSPT_DVGTVT_MA_CU = new OracleParameter("pLSPT_DVGTVT_MA_CU", OracleDbType.Varchar2, (pLSPT_DVGTVT_MA_CU == null ? DBNull.Value : (object)pLSPT_DVGTVT_MA_CU), ParameterDirection.Input);
            var _pLSPT_DVGTVT_MA_MOI = new OracleParameter("pLSPT_DVGTVT_MA_MOI", OracleDbType.Varchar2, (pLSPT_DVGTVT_MA_MOI == null ? DBNull.Value : (object)pLSPT_DVGTVT_MA_MOI), ParameterDirection.Input);
            var _pLSPT_BIENSO = new OracleParameter("pLSPT_BIENSO", OracleDbType.Varchar2, (pLSPT_BIENSO == null ? DBNull.Value : (object)pLSPT_BIENSO), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            var datas = _db.DbContext.Database.SqlQuery<CrudModel_DLSPT>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_DLSPT_CHECKEXITS(:pLSPT_DVGTVT_MA_CU,:pLSPT_DVGTVT_MA_MOI, :pLSPT_BIENSO,:pRET); end;"
                                                                                                                            , _pLSPT_DVGTVT_MA_CU
                                                                                                                            , _pLSPT_DVGTVT_MA_MOI
                                                                                                                            , _pLSPT_BIENSO
                                                                                                                            , _pRET).FirstOrDefault();

            return datas;
        }

        public CrudModelDCPDVGTVT GPS_CAPPHEP_DCPDV_CHECKEXITS(string pDCP_DVGTVT_MA, string pDCP_DVGTVT_LOAI)
        {
            DbContextHelper<GPS_NVContext> _db = Singleton<DbContextHelper<GPS_NVContext>>.Inst;
            var _pDCP_DVGTVT_MA = new OracleParameter("pDCP_DVGTVT_MA", OracleDbType.Varchar2, (pDCP_DVGTVT_MA == null ? DBNull.Value : (object)pDCP_DVGTVT_MA), ParameterDirection.Input);
            var _pDCP_DVGTVT_LOAI = new OracleParameter("pDCP_DVGTVT_LOAI", OracleDbType.Varchar2, (pDCP_DVGTVT_LOAI == null ? DBNull.Value : (object)pDCP_DVGTVT_LOAI), ParameterDirection.Input);
            var _pRET = new OracleParameter("pRET", OracleDbType.RefCursor, ParameterDirection.Output);
            var datas = _db.DbContext.Database.SqlQuery<CrudModelDCPDVGTVT>("BEGIN GPS_CAPPHEP.GPS_CAPPHEP_DCPDV_CHECKEXITS(:pDCP_DVGTVT_MA,:pDCP_DVGTVT_LOAI,:pRET); end;"
                                                                                                                            , _pDCP_DVGTVT_MA
                                                                                                                            , _pDCP_DVGTVT_LOAI
                                                                                                                            , _pRET).FirstOrDefault();

            return datas;
        }
        public void GPS_DCPDVGTVT_UPDATE(CrudModelDCPDVGTVT model)
        {

            var _pDCP_DVGTVT_MA = new OracleParameter("pDCP_DVGTVT_MA", OracleDbType.Varchar2, (model.DCP_DVGTVT_MA == null ? DBNull.Value : (object)model.DCP_DVGTVT_MA), ParameterDirection.Input);
            var _pDCP_DVGTVT_MAQL = new OracleParameter("pDCP_DVGTVT_MAQL", OracleDbType.Varchar2, (model.DCP_DVGTVT_MAQL == null ? DBNull.Value : (object)model.DCP_DVGTVT_MAQL), ParameterDirection.Input);
            var _pCP_DVGTVT_TEN = new OracleParameter("pDCP_DVGTVT_TEN", OracleDbType.Varchar2, (model.DCP_DVGTVT_TEN == null ? DBNull.Value : (object)model.DCP_DVGTVT_TEN), ParameterDirection.Input);
            var _pDCP_DVGTVT_TEL = new OracleParameter("pDCP_DVGTVT_TEL", OracleDbType.Varchar2, (model.DCP_DVGTVT_TEL == null ? DBNull.Value : (object)model.DCP_DVGTVT_TEL), ParameterDirection.Input);
            var _pDCP_DVGTVT_FAX = new OracleParameter("pDCP_DVGTVT_FAX", OracleDbType.Varchar2, (model.DCP_DVGTVT_FAX == null ? DBNull.Value : (object)model.DCP_DVGTVT_FAX), ParameterDirection.Input);
            var _pDCP_DVGTVT_ADD = new OracleParameter("pDCP_DVGTVT_ADD", OracleDbType.Varchar2, (model.DCP_DVGTVT_ADD == null ? DBNull.Value : (object)model.DCP_DVGTVT_ADD), ParameterDirection.Input);
            var _pDCP_DVGTVT_HANGGPLX = new OracleParameter("pDCP_DVGTVT_HANGGPLX", OracleDbType.Varchar2, (model.DCP_DVGTVT_HANGGPLX == null ? DBNull.Value : (object)model.DCP_DVGTVT_HANGGPLX), ParameterDirection.Input);
            var _pDCP_DVGTVT_LLDT_CU = new OracleParameter("pDCP_DVGTVT_LLDT_CU", OracleDbType.Decimal, (model.DCP_DVGTVT_LLDT_CU == null ? DBNull.Value : (object)model.DCP_DVGTVT_LLDT_CU), ParameterDirection.Input);
            var _pDCP_DVGTVT_LLDT_MOI = new OracleParameter("pDCP_DVGTVT_LLDT_MOI", OracleDbType.Decimal, (model.DCP_DVGTVT_LLDT_MOI == null ? DBNull.Value : (object)model.DCP_DVGTVT_LLDT_MOI), ParameterDirection.Input);
            var _pDCP_DVGTVT_LOAI = new OracleParameter("pDCP_DVGTVT_LOAI", OracleDbType.Varchar2, (model.DCP_DVGTVT_LOAI == null ? DBNull.Value : (object)model.DCP_DVGTVT_LOAI), ParameterDirection.Input);
            var _pDCP_SOGP_CU = new OracleParameter("pDCP_SOGP_CU", OracleDbType.Varchar2, (model.DCP_SOGP_CU == null ? DBNull.Value : (object)model.DCP_SOGP_CU), ParameterDirection.Input);
            var _pDCP_NGAYGP_CU = new OracleParameter("pDCP_NGAYGP_CU", OracleDbType.Date, (model.DCP_NGAYGP_CU == null ? DBNull.Value : (object)model.DCP_NGAYGP_CU), ParameterDirection.Input);
            var _pDCP_NGAYHHGP_CU = new OracleParameter("pDCP_NGAYHHGP_CU", OracleDbType.Date, (model.DCP_NGAYHHGP_CU == null ? DBNull.Value : (object)model.DCP_NGAYHHGP_CU), ParameterDirection.Input);
            var _pDCP_SOVB_KT = new OracleParameter("pDCP_SOVB_KT", OracleDbType.Varchar2, (model.DCP_SOVB_KT == null ? DBNull.Value : (object)model.DCP_SOVB_KT), ParameterDirection.Input);
            var _pDCP_NGAYVB_KT = new OracleParameter("pDCP_NGAYVB_KT", OracleDbType.Date, (model.DCP_NGAYVB_KT == null ? DBNull.Value : (object)model.DCP_NGAYVB_KT), ParameterDirection.Input);
            var _pDCP_SOVB_TT = new OracleParameter("pDCP_SOVB_TT", OracleDbType.Varchar2, (model.DCP_SOVB_TT == null ? DBNull.Value : (object)model.DCP_SOVB_TT), ParameterDirection.Input);
            var _pDCP_NGAYVB_TT = new OracleParameter("pDCP_NGAYVB_TT", OracleDbType.Date, (model.DCP_NGAYVB_TT == null ? DBNull.Value : (object)model.DCP_NGAYVB_TT), ParameterDirection.Input);
            var _pDCP_SOGP_MOI = new OracleParameter("pDCP_SOGP_MOI", OracleDbType.Varchar2, (model.DCP_SOGP_MOI == null ? DBNull.Value : (object)model.DCP_SOGP_MOI), ParameterDirection.Input);
            var _pDCP_NGAYGP_MOI = new OracleParameter("pDCP_NGAYGP_MOI", OracleDbType.Date, (model.DCP_NGAYGP_MOI == null ? DBNull.Value : (object)model.DCP_NGAYGP_MOI), ParameterDirection.Input);
            var _pDCP_NGAYHHGP_MOI = new OracleParameter("pDCP_NGAYHHGP_MOI", OracleDbType.Date, (model.DCP_NGAYHHGP_MOI == null ? DBNull.Value : (object)model.DCP_NGAYHHGP_MOI), ParameterDirection.Input);
            var _pDCP_MOTA = new OracleParameter("pDCP_MOTA", OracleDbType.Varchar2, (model.DCP_MOTA == null ? DBNull.Value : (object)model.DCP_MOTA), ParameterDirection.Input);
            var _pDCP_STATUS = new OracleParameter("pDCP_STATUS", OracleDbType.Varchar2, (model.DCP_STATUS == null ? DBNull.Value : (object)model.DCP_STATUS), ParameterDirection.Input);
            var _pDCP_NGAYNHAP = new OracleParameter("pDCP_NGAYNHAP", OracleDbType.Date, (model.DCP_NGAYNHAP == null ? DBNull.Value : (object)model.DCP_NGAYNHAP), ParameterDirection.Input);
            var _pDCP_NGUOINHAP = new OracleParameter("pDCP_NGUOINHAP", OracleDbType.Varchar2, (model.DCP_NGUOINHAP == null ? DBNull.Value : (object)model.DCP_NGUOINHAP), ParameterDirection.Input);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_DCPDVGTVT_UPDATE"
                                                                , _pDCP_DVGTVT_MA
                                                                , _pDCP_DVGTVT_MAQL
                                                                , _pCP_DVGTVT_TEN
                                                                , _pDCP_DVGTVT_TEL
                                                                , _pDCP_DVGTVT_FAX
                                                                , _pDCP_DVGTVT_ADD
                                                                , _pDCP_DVGTVT_HANGGPLX
                                                                , _pDCP_DVGTVT_LLDT_CU
                                                                , _pDCP_DVGTVT_LLDT_MOI
                                                                , _pDCP_DVGTVT_LOAI
                                                                , _pDCP_SOGP_CU
                                                                , _pDCP_NGAYGP_CU
                                                                , _pDCP_NGAYHHGP_CU
                                                                , _pDCP_SOVB_KT
                                                                , _pDCP_NGAYVB_KT
                                                                , _pDCP_SOVB_TT
                                                                , _pDCP_NGAYVB_TT
                                                                , _pDCP_SOGP_MOI
                                                                , _pDCP_NGAYGP_MOI
                                                                , _pDCP_NGAYHHGP_MOI
                                                                , _pDCP_MOTA
                                                                , _pDCP_STATUS
                                                                , _pDCP_NGAYNHAP
                                                                , _pDCP_NGUOINHAP
                                                                );

        }
        public void GPS_DCPGV_INSERT(CrudModelDCPGV model)
        {

            var pDCP_GV_MA = new OracleParameter("pDCP_GV_MA", OracleDbType.Varchar2, (model.DCP_GV_MA == null ? DBNull.Value : (object)model.DCP_GV_MA), ParameterDirection.Input);
            var pDCP_GV_DVGTVT_MA = new OracleParameter("pDCP_GV_DVGTVT_MA", OracleDbType.Varchar2, (model.DCP_GV_DVGTVT_MA == null ? DBNull.Value : (object)model.DCP_GV_DVGTVT_MA), ParameterDirection.Input);
            var pDCP_GV_DVGTVT_TEN = new OracleParameter("pDCP_GV_DVGTVT_TEN", OracleDbType.Varchar2, (model.DCP_GV_DVGTVT_TEN == null ? DBNull.Value : (object)model.DCP_GV_DVGTVT_TEN), ParameterDirection.Input);
            var pDCP_GV_HANGDT_MA = new OracleParameter("pDCP_GV_HANGDT_MA", OracleDbType.Varchar2, (model.DCP_GV_HANGDT_MA == null ? DBNull.Value : (object)model.DCP_GV_HANGDT_MA), ParameterDirection.Input);
            var pDCP_GV_HODEM = new OracleParameter("pDCP_GV_HODEM", OracleDbType.Varchar2, (model.DCP_GV_HODEM == null ? DBNull.Value : (object)model.DCP_GV_HODEM), ParameterDirection.Input);
            var pDCP_GV_TEN = new OracleParameter("pDCP_GV_TEN", OracleDbType.Varchar2, (model.DCP_GV_TEN == null ? DBNull.Value : (object)model.DCP_GV_TEN), ParameterDirection.Input);
            var pDCP_GV_NGAYSINH = new OracleParameter("pDCP_GV_NGAYSINH", OracleDbType.Date, (model.DCP_GV_NGAYSINH == null ? DBNull.Value : (object)model.DCP_GV_NGAYSINH), ParameterDirection.Input);
            var pDCP_GV_ANHCD = new OracleParameter("pDCP_GV_ANHCD", OracleDbType.Blob, (model.DCP_GV_ANHCD == null ? DBNull.Value : (object)model.DCP_GV_ANHCD), ParameterDirection.Input);
            var pDCP_GV_SOCMT = new OracleParameter("pDCP_GV_SOCMT", OracleDbType.Varchar2, (model.DCP_GV_SOCMT == null ? DBNull.Value : (object)model.DCP_GV_SOCMT), ParameterDirection.Input);
            var pDCP_GV_SOQD = new OracleParameter("pDCP_GV_SOQD", OracleDbType.Varchar2, (model.DCP_GV_SOQD == null ? DBNull.Value : (object)model.DCP_GV_SOQD), ParameterDirection.Input);
            var pDCP_GV_NGAYQD = new OracleParameter("pDCP_GV_NGAYQD", OracleDbType.Date, (model.DCP_GV_NGAYQD == null ? DBNull.Value : (object)model.DCP_GV_NGAYQD), ParameterDirection.Input);
            var pDCP_NGAYDT_TU = new OracleParameter("pDCP_NGAYDT_TU", OracleDbType.Date, (model.DCP_NGAYDT_TU == null ? DBNull.Value : (object)model.DCP_NGAYDT_TU), ParameterDirection.Input);
            var pDCP_NGAYDT_DEN = new OracleParameter("pDCP_NGAYDT_DEN", OracleDbType.Date, (model.DCP_NGAYDT_DEN == null ? DBNull.Value : (object)model.DCP_NGAYDT_DEN), ParameterDirection.Input);
            var pDCP_GV_SOQD_GCN = new OracleParameter("pDCP_GV_SOQD_GCN", OracleDbType.Varchar2, (model.DCP_GV_SOQD_GCN == null ? DBNull.Value : (object)model.DCP_GV_SOQD_GCN), ParameterDirection.Input);
            var pDCP_GV_NGAYQD_GCN = new OracleParameter("pDCP_GV_NGAYQD_GCN", OracleDbType.Date, (model.DCP_GV_NGAYQD_GCN == null ? DBNull.Value : (object)model.DCP_GV_NGAYQD_GCN), ParameterDirection.Input);
            var pDCP_GV_NGAYNHAP = new OracleParameter("pDCP_GV_NGAYNHAP", OracleDbType.Date, (model.DCP_GV_NGAYNHAP == null ? DBNull.Value : (object)model.DCP_GV_NGAYNHAP), ParameterDirection.Input);
            var pDCP_GV_NGUOINHAP = new OracleParameter("pDCP_GV_NGUOINHAP", OracleDbType.Date, (model.DCP_GV_NGUOINHAP == null ? DBNull.Value : (object)model.DCP_GV_NGUOINHAP), ParameterDirection.Input);
            var pDCP_GV_STATUS = new OracleParameter("pDCP_GV_STATUS", OracleDbType.Date, (model.DCP_GV_STATUS == null ? DBNull.Value : (object)model.DCP_GV_STATUS), ParameterDirection.Input);
            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_DCPGV_INSERT"
                                                                , pDCP_GV_MA
                                                                , pDCP_GV_DVGTVT_MA
                                                                , pDCP_GV_DVGTVT_TEN
                                                                , pDCP_GV_HANGDT_MA
                                                                , pDCP_GV_HODEM
                                                                , pDCP_GV_TEN
                                                                , pDCP_GV_NGAYSINH
                                                                , pDCP_GV_ANHCD
                                                                , pDCP_GV_SOCMT
                                                                , pDCP_GV_SOQD
                                                                , pDCP_GV_NGAYQD
                                                                , pDCP_NGAYDT_TU
                                                                , pDCP_NGAYDT_DEN
                                                                , pDCP_GV_SOQD_GCN
                                                                , pDCP_GV_NGAYQD_GCN
                                                                , pDCP_GV_NGAYNHAP
                                                                , pDCP_GV_NGUOINHAP
                                                                , pDCP_GV_STATUS
                                                                );

        }

        public void GPS_DCPDVGTVT_INSERT(CrudModelDCPDVGTVT model)
        {

            var _pDCP_DVGTVT_MA = new OracleParameter("pDCP_DVGTVT_MA", OracleDbType.Varchar2, (model.DCP_DVGTVT_MA == null ? DBNull.Value : (object)model.DCP_DVGTVT_MA), ParameterDirection.Input);
            var _pDCP_DVGTVT_MAQL = new OracleParameter("pDCP_DVGTVT_MAQL", OracleDbType.Varchar2, (model.DCP_DVGTVT_MAQL == null ? DBNull.Value : (object)model.DCP_DVGTVT_MAQL), ParameterDirection.Input);
            var _pCP_DVGTVT_TEN = new OracleParameter("pDCP_DVGTVT_TEN", OracleDbType.Varchar2, (model.DCP_DVGTVT_TEN == null ? DBNull.Value : (object)model.DCP_DVGTVT_TEN), ParameterDirection.Input);
            var _pDCP_DVGTVT_TEL = new OracleParameter("pDCP_DVGTVT_TEL", OracleDbType.Varchar2, (model.DCP_DVGTVT_TEL == null ? DBNull.Value : (object)model.DCP_DVGTVT_TEL), ParameterDirection.Input);
            var _pDCP_DVGTVT_FAX = new OracleParameter("pDCP_DVGTVT_FAX", OracleDbType.Varchar2, (model.DCP_DVGTVT_FAX == null ? DBNull.Value : (object)model.DCP_DVGTVT_FAX), ParameterDirection.Input);
            var _pDCP_DVGTVT_ADD = new OracleParameter("pDCP_DVGTVT_ADD", OracleDbType.Varchar2, (model.DCP_DVGTVT_ADD == null ? DBNull.Value : (object)model.DCP_DVGTVT_ADD), ParameterDirection.Input);
            var _pDCP_DVGTVT_HANGGPLX = new OracleParameter("pDCP_DVGTVT_HANGGPLX", OracleDbType.Varchar2, (model.DCP_DVGTVT_HANGGPLX == null ? DBNull.Value : (object)model.DCP_DVGTVT_HANGGPLX), ParameterDirection.Input);
            var _pDCP_DVGTVT_LLDT_CU = new OracleParameter("pDCP_DVGTVT_LLDT_CU", OracleDbType.Decimal, (model.DCP_DVGTVT_LLDT_CU == null ? DBNull.Value : (object)model.DCP_DVGTVT_LLDT_CU), ParameterDirection.Input);
            var _pDCP_DVGTVT_LLDT_MOI = new OracleParameter("pDCP_DVGTVT_LLDT_MOI", OracleDbType.Decimal, (model.DCP_DVGTVT_LLDT_MOI == null ? DBNull.Value : (object)model.DCP_DVGTVT_LLDT_MOI), ParameterDirection.Input);
            var _pDCP_DVGTVT_LOAI = new OracleParameter("pDCP_DVGTVT_LOAI", OracleDbType.Varchar2, (model.DCP_DVGTVT_LOAI == null ? DBNull.Value : (object)model.DCP_DVGTVT_LOAI), ParameterDirection.Input);
            var _pDCP_SOGP_CU = new OracleParameter("pDCP_SOGP_CU", OracleDbType.Varchar2, (model.DCP_SOGP_CU == null ? DBNull.Value : (object)model.DCP_SOGP_CU), ParameterDirection.Input);
            var _pDCP_NGAYGP_CU = new OracleParameter("pDCP_NGAYGP_CU", OracleDbType.Date, (model.DCP_NGAYGP_CU == null ? DBNull.Value : (object)model.DCP_NGAYGP_CU), ParameterDirection.Input);
            var _pDCP_NGAYHHGP_CU = new OracleParameter("pDCP_NGAYHHGP_CU", OracleDbType.Date, (model.DCP_NGAYHHGP_CU == null ? DBNull.Value : (object)model.DCP_NGAYHHGP_CU), ParameterDirection.Input);
            var _pDCP_SOVB_KT = new OracleParameter("pDCP_SOVB_KT", OracleDbType.Varchar2, (model.DCP_SOVB_KT == null ? DBNull.Value : (object)model.DCP_SOVB_KT), ParameterDirection.Input);
            var _pDCP_NGAYVB_KT = new OracleParameter("pDCP_NGAYVB_KT", OracleDbType.Date, (model.DCP_NGAYVB_KT == null ? DBNull.Value : (object)model.DCP_NGAYVB_KT), ParameterDirection.Input);
            var _pDCP_SOVB_TT = new OracleParameter("pDCP_SOVB_TT", OracleDbType.Varchar2, (model.DCP_SOVB_TT == null ? DBNull.Value : (object)model.DCP_SOVB_TT), ParameterDirection.Input);
            var _pDCP_NGAYVB_TT = new OracleParameter("pDCP_NGAYVB_TT", OracleDbType.Date, (model.DCP_NGAYVB_TT == null ? DBNull.Value : (object)model.DCP_NGAYVB_TT), ParameterDirection.Input);
            var _pDCP_SOGP_MOI = new OracleParameter("pDCP_SOGP_MOI", OracleDbType.Varchar2, (model.DCP_SOGP_MOI == null ? DBNull.Value : (object)model.DCP_SOGP_MOI), ParameterDirection.Input);
            var _pDCP_NGAYGP_MOI = new OracleParameter("pDCP_NGAYGP_MOI", OracleDbType.Date, (model.DCP_NGAYGP_MOI == null ? DBNull.Value : (object)model.DCP_NGAYGP_MOI), ParameterDirection.Input);
            var _pDCP_NGAYHHGP_MOI = new OracleParameter("pDCP_NGAYHHGP_MOI", OracleDbType.Date, (model.DCP_NGAYHHGP_MOI == null ? DBNull.Value : (object)model.DCP_NGAYHHGP_MOI), ParameterDirection.Input);
            var _pDCP_MOTA = new OracleParameter("pDCP_MOTA", OracleDbType.Varchar2, (model.DCP_MOTA == null ? DBNull.Value : (object)model.DCP_MOTA), ParameterDirection.Input);
            var _pDCP_STATUS = new OracleParameter("pDCP_STATUS", OracleDbType.Varchar2, (model.DCP_STATUS == null ? DBNull.Value : (object)model.DCP_STATUS), ParameterDirection.Input);
            var _pDCP_NGAYNHAP = new OracleParameter("pDCP_NGAYNHAP", OracleDbType.Date, (model.DCP_NGAYNHAP == null ? DBNull.Value : (object)model.DCP_NGAYNHAP), ParameterDirection.Input);
            var _pDCP_NGUOINHAP = new OracleParameter("pDCP_NGUOINHAP", OracleDbType.Varchar2, (model.DCP_NGUOINHAP == null ? DBNull.Value : (object)model.DCP_NGUOINHAP), ParameterDirection.Input);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_DCPDVGTVT_INSERT"
                                                                , _pDCP_DVGTVT_MA
                                                                , _pDCP_DVGTVT_MAQL
                                                                , _pCP_DVGTVT_TEN
                                                                , _pDCP_DVGTVT_TEL
                                                                , _pDCP_DVGTVT_FAX
                                                                , _pDCP_DVGTVT_ADD
                                                                , _pDCP_DVGTVT_HANGGPLX
                                                                , _pDCP_DVGTVT_LLDT_CU
                                                                , _pDCP_DVGTVT_LLDT_MOI
                                                                , _pDCP_DVGTVT_LOAI
                                                                , _pDCP_SOGP_CU
                                                                , _pDCP_NGAYGP_CU
                                                                , _pDCP_NGAYHHGP_CU
                                                                , _pDCP_SOVB_KT
                                                                , _pDCP_NGAYVB_KT
                                                                , _pDCP_SOVB_TT
                                                                , _pDCP_NGAYVB_TT
                                                                , _pDCP_SOGP_MOI
                                                                , _pDCP_NGAYGP_MOI
                                                                , _pDCP_NGAYHHGP_MOI
                                                                , _pDCP_MOTA
                                                                , _pDCP_STATUS
                                                                , _pDCP_NGAYNHAP
                                                                , _pDCP_NGUOINHAP
                                                                );

        }

        public void GPS_DCPGV_UPDATE(CrudModelDCPGV model)
        {
            var _pDCP_GV_MA = new OracleParameter("pDCP_GV_MA", OracleDbType.Varchar2, (model.DCP_GV_MA == null ? DBNull.Value : (object)model.DCP_GV_MA), ParameterDirection.Input);
            var _pDCP_GV_DVGTVT_MA = new OracleParameter("pDCP_GV_DVGTVT_MA", OracleDbType.Varchar2, (model.DCP_GV_DVGTVT_MA == null ? DBNull.Value : (object)model.DCP_GV_DVGTVT_MA), ParameterDirection.Input);
            var _pDCP_GV_SOQD = new OracleParameter("pDCP_GV_SOQD", OracleDbType.Varchar2, (model.DCP_GV_SOQD == null ? DBNull.Value : (object)model.DCP_GV_SOQD), ParameterDirection.Input);
            var _pDCP_GV_NGAYQD = new OracleParameter("pDCP_GV_NGAYQD", OracleDbType.Date, (model.DCP_GV_NGAYQD == null ? DBNull.Value : (object)model.DCP_GV_NGAYQD), ParameterDirection.Input);
            var _pDCP_NGAYDT_TU = new OracleParameter("pDCP_NGAYDT_TU", OracleDbType.Date, (model.DCP_NGAYDT_TU == null ? DBNull.Value : (object)model.DCP_NGAYDT_TU), ParameterDirection.Input);
            var _pDCP_NGAYDT_DEN = new OracleParameter("pDCP_NGAYDT_DEN", OracleDbType.Date, (model.DCP_NGAYDT_DEN == null ? DBNull.Value : (object)model.DCP_NGAYDT_DEN), ParameterDirection.Input);
            var _pDCP_GV_SOQD_GCN = new OracleParameter("pDCP_GV_SOQD_GCN", OracleDbType.Varchar2, (model.DCP_GV_SOQD_GCN == null ? DBNull.Value : (object)model.DCP_GV_SOQD_GCN), ParameterDirection.Input);
            var _pDCP_GV_NGAYQD_GCN = new OracleParameter("pDCP_GV_NGAYQD_GCN", OracleDbType.Date, (model.DCP_GV_NGAYQD_GCN == null ? DBNull.Value : (object)model.DCP_GV_NGAYQD_GCN), ParameterDirection.Input);
            var _pDCP_GV_NGAYNHAP = new OracleParameter("pDCP_GV_NGAYNHAP", OracleDbType.Date, (model.DCP_GV_NGAYNHAP == null ? DBNull.Value : (object)model.DCP_GV_NGAYNHAP), ParameterDirection.Input);
            var _pDCP_GV_NGUOINHAP = new OracleParameter("pDCP_GV_NGUOINHAP", OracleDbType.Varchar2, (model.DCP_GV_NGUOINHAP == null ? DBNull.Value : (object)model.DCP_GV_NGUOINHAP), ParameterDirection.Input);
            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_DCPGV_UPDATE"
                                                                , _pDCP_GV_MA
                                                                , _pDCP_GV_DVGTVT_MA
                                                                , _pDCP_GV_SOQD
                                                                , _pDCP_GV_NGAYQD
                                                                , _pDCP_NGAYDT_TU
                                                                , _pDCP_NGAYDT_DEN
                                                                , _pDCP_GV_SOQD_GCN
                                                                , _pDCP_GV_NGAYQD_GCN
                                                                , _pDCP_GV_NGAYNHAP
                                                                , _pDCP_GV_NGUOINHAP
                                                                );

        }

        public void GPS_DBCI_UPDATE(CrudModelDBCI model)
        {
            var pBCI_MA = new OracleParameter("pBCI_MA", OracleDbType.Varchar2, (model.BCI_MA == null ? DBNull.Value : (object)model.BCI_MA), ParameterDirection.Input);
            var pBCI_DVGTVT_MA = new OracleParameter("pBCI_DVGTVT_MA", OracleDbType.Varchar2, (model.BCI_DVGTVT_MA == null ? DBNull.Value : (object)model.BCI_DVGTVT_MA), ParameterDirection.Input);
            var pBCI_KH_MA = new OracleParameter("pBCI_KH_MA", OracleDbType.Varchar2, (model.BCI_KH_MA == null ? DBNull.Value : (object)model.BCI_KH_MA), ParameterDirection.Input);
            var pBCI_TRANGTHAI = new OracleParameter("pBCI_TRANGTHAI", OracleDbType.Varchar2, (model.BCI_TRANGTHAI == null ? DBNull.Value : (object)model.BCI_TRANGTHAI), ParameterDirection.Input);
            var pUSER_LOG = new OracleParameter("pUSER_LOG", OracleDbType.Varchar2, (model.BCI_NGUOINHAP == null ? DBNull.Value : (object)model.BCI_NGUOINHAP), ParameterDirection.Input); //BCI_NGUOINHAP
            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_DBCI_UPDATE"
                                                                , pBCI_MA
                                                                , pBCI_DVGTVT_MA
                                                                , pBCI_KH_MA
                                                                , pBCI_TRANGTHAI
                                                                , pUSER_LOG
                                                                );

        }
        public void GPS_CAPPHEP_DLSPT_INSERT(CrudModel_DLSPT model)
        {

            var _pLSPT_BIENSO = new OracleParameter("pLSPT_BIENSO", OracleDbType.Varchar2, (model.LSPT_BIENSO == null ? DBNull.Value : (object)model.LSPT_BIENSO), ParameterDirection.Input);
            var _pLSPT_DVGTVT_MA_CU = new OracleParameter("pLSPT_DVGTVT_MA_CU", OracleDbType.Varchar2, (model.LSPT_DVGTVT_MA_CU == null ? DBNull.Value : (object)model.LSPT_DVGTVT_MA_CU), ParameterDirection.Input);
            var _pLSPT_DVGTVT_MA_MOI = new OracleParameter("pLSPT_DVGTVT_MA_MOI", OracleDbType.Varchar2, (model.LSPT_DVGTVT_MA_MOI == null ? DBNull.Value : (object)model.LSPT_DVGTVT_MA_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYGCNKD_CU = new OracleParameter("pLSPT_NGAYGCNKD_CU", OracleDbType.Date, (model.LSPT_NGAYGCNKD_CU == null ? DBNull.Value : (object)model.LSPT_NGAYGCNKD_CU), ParameterDirection.Input);
            var _pLSPT_NGAYHHGCNKD_CU = new OracleParameter("pLSPT_NGAYHHGCNKD_CU", OracleDbType.Date, (model.LSPT_NGAYHHGCNKD_CU == null ? DBNull.Value : (object)model.LSPT_NGAYHHGCNKD_CU), ParameterDirection.Input);
            var _pLSPT_NGAYGCNKD_MOI = new OracleParameter("pLSPT_NGAYGCNKD_MOI", OracleDbType.Date, (model.LSPT_NGAYGCNKD_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYGCNKD_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYHHGCNKD_MOI = new OracleParameter("pLSPT_NGAYHHGCNKD_MOI", OracleDbType.Date, (model.LSPT_NGAYHHGCNKD_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYHHGCNKD_MOI), ParameterDirection.Input);
            var _pLSPT_SOGPXTL_CU = new OracleParameter("pLSPT_SOGPXTL_CU", OracleDbType.Varchar2, (model.LSPT_SOGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_SOGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_CQCAPGPXTL_CU = new OracleParameter("pLSPT_CQCAPGPXTL_CU", OracleDbType.Varchar2, (model.LSPT_CQCAPGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_CQCAPGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_NGAYGPXTL_CU = new OracleParameter("pLSPT_NGAYGPXTL_CU", OracleDbType.Date, (model.LSPT_NGAYGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_NGAYGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_NGAYHHGPXTL_CU = new OracleParameter("pLSPT_NGAYHHGPXTL_CU", OracleDbType.Date, (model.LSPT_NGAYHHGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_NGAYHHGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_SOGPXTL_MOI = new OracleParameter("pLSPT_SOGPXTL_MOI", OracleDbType.Varchar2, (model.LSPT_SOGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_SOGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_CQCAPGPXTL_MOI = new OracleParameter("pLSPT_CQCAPGPXTL_MOI", OracleDbType.Varchar2, (model.LSPT_CQCAPGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_CQCAPGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYGPXTL_MOI = new OracleParameter("pLSPT_NGAYGPXTL_MOI", OracleDbType.Date, (model.LSPT_NGAYGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYHHGPXTL_MOI = new OracleParameter("pLSPT_NGAYHHGPXTL_MOI", OracleDbType.Date, (model.LSPT_NGAYHHGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYHHGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_MOTA = new OracleParameter("pLSPT_MOTA", OracleDbType.Varchar2, (model.LSPT_MOTA == null ? DBNull.Value : (object)model.LSPT_MOTA), ParameterDirection.Input);
            var _pLSPT_STATUS = new OracleParameter("pLSPT_STATUS", OracleDbType.Varchar2, (model.LSPT_STATUS == null ? DBNull.Value : (object)model.LSPT_STATUS), ParameterDirection.Input);
            var _pLSPT_NGAYNHAP = new OracleParameter("pLSPT_NGAYNHAP", OracleDbType.Date, (model.LSPT_NGAYNHAP == null ? DBNull.Value : (object)model.LSPT_NGAYNHAP), ParameterDirection.Input);
            var _pLSPT_NGUOINHAP = new OracleParameter("pLSPT_NGUOINHAP", OracleDbType.Varchar2, (model.LSPT_NGUOINHAP == null ? DBNull.Value : (object)model.LSPT_NGUOINHAP), ParameterDirection.Input);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_CAPPHEP_DLSPT_INSERT"
                                                                , _pLSPT_BIENSO
                                                                , _pLSPT_DVGTVT_MA_CU
                                                                , _pLSPT_DVGTVT_MA_MOI
                                                                , _pLSPT_NGAYGCNKD_CU
                                                                , _pLSPT_NGAYHHGCNKD_CU
                                                                , _pLSPT_NGAYGCNKD_MOI
                                                                , _pLSPT_NGAYHHGCNKD_MOI
                                                                , _pLSPT_SOGPXTL_CU
                                                                , _pLSPT_CQCAPGPXTL_CU
                                                                , _pLSPT_NGAYGPXTL_CU
                                                                , _pLSPT_NGAYHHGPXTL_CU
                                                                , _pLSPT_SOGPXTL_MOI
                                                                , _pLSPT_CQCAPGPXTL_MOI
                                                                , _pLSPT_NGAYGPXTL_MOI
                                                                , _pLSPT_NGAYHHGPXTL_MOI
                                                                , _pLSPT_MOTA
                                                                , _pLSPT_STATUS
                                                                , _pLSPT_NGAYNHAP
                                                                , _pLSPT_NGUOINHAP
                                                                );

        }


        public void GPS_CAPPHEP_DLSPT_UPDATE(CrudModel_DLSPT model)
        {
            var _pLSPT_BIENSO = new OracleParameter("pLSPT_BIENSO", OracleDbType.Varchar2, (model.LSPT_BIENSO == null ? DBNull.Value : (object)model.LSPT_BIENSO), ParameterDirection.Input);
            var _pLSPT_DVGTVT_MA_CU = new OracleParameter("pLSPT_DVGTVT_MA_CU", OracleDbType.Varchar2, (model.LSPT_DVGTVT_MA_CU == null ? DBNull.Value : (object)model.LSPT_DVGTVT_MA_CU), ParameterDirection.Input);
            var _pLSPT_DVGTVT_MA_MOI = new OracleParameter("pLSPT_DVGTVT_MA_MOI", OracleDbType.Varchar2, (model.LSPT_DVGTVT_MA_MOI == null ? DBNull.Value : (object)model.LSPT_DVGTVT_MA_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYGCNKD_CU = new OracleParameter("pLSPT_NGAYGCNKD_CU", OracleDbType.Date, (model.LSPT_NGAYGCNKD_CU == null ? DBNull.Value : (object)model.LSPT_NGAYGCNKD_CU), ParameterDirection.Input);
            var _pLSPT_NGAYHHGCNKD_CU = new OracleParameter("pLSPT_NGAYHHGCNKD_CU", OracleDbType.Date, (model.LSPT_NGAYHHGCNKD_CU == null ? DBNull.Value : (object)model.LSPT_NGAYHHGCNKD_CU), ParameterDirection.Input);
            var _pLSPT_NGAYGCNKD_MOI = new OracleParameter("pLSPT_NGAYGCNKD_MOI", OracleDbType.Date, (model.LSPT_NGAYGCNKD_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYGCNKD_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYHHGCNKD_MOI = new OracleParameter("pLSPT_NGAYHHGCNKD_MOI", OracleDbType.Date, (model.LSPT_NGAYHHGCNKD_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYHHGCNKD_MOI), ParameterDirection.Input);
            var _pLSPT_SOGPXTL_CU = new OracleParameter("pLSPT_SOGPXTL_CU", OracleDbType.Varchar2, (model.LSPT_SOGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_SOGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_CQCAPGPXTL_CU = new OracleParameter("pLSPT_CQCAPGPXTL_CU", OracleDbType.Varchar2, (model.LSPT_CQCAPGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_CQCAPGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_NGAYGPXTL_CU = new OracleParameter("pLSPT_NGAYGPXTL_CU", OracleDbType.Date, (model.LSPT_NGAYGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_NGAYGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_NGAYHHGPXTL_CU = new OracleParameter("pLSPT_NGAYHHGPXTL_CU", OracleDbType.Date, (model.LSPT_NGAYHHGPXTL_CU == null ? DBNull.Value : (object)model.LSPT_NGAYHHGPXTL_CU), ParameterDirection.Input);
            var _pLSPT_SOGPXTL_MOI = new OracleParameter("pLSPT_SOGPXTL_MOI", OracleDbType.Varchar2, (model.LSPT_SOGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_SOGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_CQCAPGPXTL_MOI = new OracleParameter("pLSPT_CQCAPGPXTL_MOI", OracleDbType.Varchar2, (model.LSPT_CQCAPGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_CQCAPGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYGPXTL_MOI = new OracleParameter("pLSPT_NGAYGPXTL_MOI", OracleDbType.Date, (model.LSPT_NGAYGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_NGAYHHGPXTL_MOI = new OracleParameter("pLSPT_NGAYHHGPXTL_MOI", OracleDbType.Date, (model.LSPT_NGAYHHGPXTL_MOI == null ? DBNull.Value : (object)model.LSPT_NGAYHHGPXTL_MOI), ParameterDirection.Input);
            var _pLSPT_MOTA = new OracleParameter("pLSPT_MOTA", OracleDbType.Varchar2, (model.LSPT_MOTA == null ? DBNull.Value : (object)model.LSPT_MOTA), ParameterDirection.Input);
            var _pLSPT_STATUS = new OracleParameter("pLSPT_STATUS", OracleDbType.Varchar2, (model.LSPT_STATUS == null ? DBNull.Value : (object)model.LSPT_STATUS), ParameterDirection.Input);
            var _pLSPT_NGAYNHAP = new OracleParameter("pLSPT_NGAYNHAP", OracleDbType.Date, (model.LSPT_NGAYNHAP == null ? DBNull.Value : (object)model.LSPT_NGAYNHAP), ParameterDirection.Input);
            var _pLSPT_NGUOINHAP = new OracleParameter("pLSPT_NGUOINHAP", OracleDbType.Varchar2, (model.LSPT_NGUOINHAP == null ? DBNull.Value : (object)model.LSPT_NGUOINHAP), ParameterDirection.Input);

            string connectionString = System.Configuration.ConfigurationManager.AppSettings["OracleConnectionString"];
            OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure
                                                                , "GPS_CAPPHEP.GPS_CAPPHEP_DLSPT_UPDATE"
                                                                , _pLSPT_BIENSO
                                                                , _pLSPT_DVGTVT_MA_CU
                                                                , _pLSPT_DVGTVT_MA_MOI
                                                                , _pLSPT_NGAYGCNKD_CU
                                                                , _pLSPT_NGAYHHGCNKD_CU
                                                                , _pLSPT_NGAYGCNKD_MOI
                                                                , _pLSPT_NGAYHHGCNKD_MOI
                                                                , _pLSPT_SOGPXTL_CU
                                                                , _pLSPT_CQCAPGPXTL_CU
                                                                , _pLSPT_NGAYGPXTL_CU
                                                                , _pLSPT_NGAYHHGPXTL_CU
                                                                , _pLSPT_SOGPXTL_MOI
                                                                , _pLSPT_CQCAPGPXTL_MOI
                                                                , _pLSPT_NGAYGPXTL_MOI
                                                                , _pLSPT_NGAYHHGPXTL_MOI
                                                                , _pLSPT_MOTA
                                                                , _pLSPT_STATUS
                                                                , _pLSPT_NGAYNHAP
                                                                , _pLSPT_NGUOINHAP
                                                                );

        }

    }

}